<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	  			xmlns:h="http://java.sun.com/jsf/html"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:c="http://java.sun.com/jsp/jstl/core"
	  			xmlns:p="http://primefaces.prime.com.tr/ui"
	  			template="/WEB-INF/layouts/basic.xhtml">
	<ui:define name="content">
		<div class="centered">
			<c:if test="${not empty param.login_error}">
				<div class="error">
					Your login attempt was unsuccessful, please try again.<br />
					Reason: Invalid username or password<br />
				</div>
			</c:if>
			
			<p:panel header="Login">
				<form name="f" action="${request.contextPath}/app/j_spring_security_check" method="post">
					<p>
						<c:if test="${not empty param.login_error}">
							<c:set var="username" value="${sessionScope.SPRING_SECURITY_LAST_USERNAME}" />
						</c:if>
						<h:outputLabel for="username" value="Username" />
						<br />
						<input type="text" id="username" name="j_username" value="#{username}" />
					</p>
					<p>
						<h:outputLabel for="password" value="Password" />
						<br />
						<input type="password" id="username" name="j_password" />			
					</p>
					<p>
						<h:commandButton styleClass="fg-button ui-state-default ui-corner-all" type="submit" value="Login" />
					</p>
				</form>
			</p:panel>
		</div>
	</ui:define>
</ui:composition>